import numpy as np
import pandas as pd
from sklearn.manifold import Isomap


inputfile = '../process_data/data/kaggle_bike_processed.csv'
outputfile = 'data/isomap_dimention_reducted.csv' #降维后的数据

# 读入数据
dataSet = pd.read_csv(inputfile, header=0) #读入数据

# 得到训练数据和目标值
target = dataSet['count'].values
data = dataSet.drop(['count'], axis=1).values

isomap = Isomap(n_components=3)
isomap.fit(data)
X_new = isomap.fit_transform(data)


pd.DataFrame(X_new).to_csv(outputfile,  index=0, header=0, float_format="%0.4f")
